﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Commerce.CSK.Web
{
    public class ItemViewPage:System.Web.UI.Page 
    {
        public virtual int? ItemId
        {
            get
            {
                //Check the viewstate. 
                int itemId = -1;
                object viewStateValue = ViewState["itemId"];
                if (viewStateValue != null)
                {
                    if (int.TryParse(viewStateValue.ToString(), out itemId))
                    {
                        return new int?(itemId);
                    }

                }
                return null;
            }
            set
            {
                //Set the viewstate for the new value. 
                if (value != null)
                {
                    ViewState["itemId"] = value.Value;
                }
                else
                {
                    ViewState["itemId"] = null;
                }
            }
        }
    }
}
